"""
Created on 2022-04-06
@author:刘飞
@description:手写数字的数据集MNIST
"""
from pprint import pprint
import numpy as np
from matplotlib import pyplot
from scipy import special

data_file = open('./mnist_dataset/mnist_test_10.csv', 'r')
data_list = data_file.readlines()
data_file.close()

all_values = data_list[0].split(',')

"""展现图片形式"""
image_array = np.asfarray(all_values[1:]).reshape((28, 28))
pyplot.imshow(image_array, cmap='Greys', interpolation='None')
pyplot.show()

scaled_input = (np.asfarray(all_values[1:]) / 255.0 * 0.99) + 0.01
pprint(scaled_input)
